package com.wzy.webuserdemo.service.impl;

import com.wzy.webuserdemo.dao.UserMapper;
import com.wzy.webuserdemo.pojo.User;
import com.wzy.webuserdemo.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User getUserByName(String name) {
        return userMapper.getUserByName(name);
    }

    @Override
    public List<User> queryUserList() {
        return userMapper.queryUserList();
    }

    @Override
    public boolean insertUser(User user) {
        return userMapper.addUser(user)>0;
    }

    @Override
    public User getById(Long id) {
        return userMapper.getById(id);
    }

    @Override
    public boolean updateUser(User user) {
        return userMapper.updateUser(user)>0;
    }

    @Override
    public boolean delUser(long id) {
        return userMapper.deleteUser(id)>0;
    }


}
